package PTA_work;

import java.util.Arrays;
import java.util.Scanner;
class NumberFormatException extends RuntimeException {
    public NumberFormatException() {
    }
    public NumberFormatException(String message) {
        System.out.println("java.lang.NumberFormatException: For input string:\""+message+"\"");
    }
}
public class test_7_71 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] arr = new int[n];

        int i = 0;
        while(i < n) {
            String tmp = scan.next();
            try {
                if(!tmp.matches("\\d")) {
                    throw new NumberFormatException(tmp);
                }
                else {
                    arr[i] = Integer.parseInt(tmp);
                    i++;
                }
            }catch (NumberFormatException e) {
                e.printStackTrace();
            }
        }
        System.out.println(Arrays.toString(arr));
    }
}
